/* 工位机端的 store  状态管理 */

const state = {
  stId: '', // 工位ID
  stName: '', // 工位名称
  internalIp: '', // 内网IP
  dpId: '', // 派工Id
  checkInRefresh: '', // 刷新上工表 标识
  showAdvertising: 'isShow' // 显示广告
}

const mutations = {
  SET_STID: (state, stId) => {
    state.stId = stId
  },
  SET_STNAME: (state, stName) => {
    state.stName = stName
  },
  SET_INTERNALIP: (state, internalIp) => {
    state.internalIp = internalIp
  },
  SET_DPID: (state, dpId) => {
    state.dpId = dpId
  },
  SET_CHECKINREFRESH: (state, checkInRefresh) => {
    state.checkInRefresh = checkInRefresh
  },
  SET_SHOWADVERTISING: (state, showAdvertising) => {
    state.showAdvertising = showAdvertising
  }
}

const actions = {
  setStId({ commit }, data) {
    commit('SET_STID', data)
  },
  setStName({ commit }, data) {
    commit('SET_STNAME', data)
  },
  setStInternalIp({ commit }, data) {
    commit('SET_INTERNALIP', data)
  },
  setDpId({ commit }, data) {
    commit('SET_DPID', data)
  },
  setCheckInRefresh({ commit }, data) {
    commit('SET_CHECKINREFRESH', data)
  },
  setShowAdvertising({ commit }, data) {
    commit('SET_SHOWADVERTISING', data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

